<html>
<head>
<style>
  .ace_editor {
    border: 0;
    width: auto;
    height: 100%;
    margin: 0;
    top:0;
    right:0;
    bottom:0;
    left:0;
    z-index: 10000;
    touch-action: none;
  }

  body {
    padding: 0px;
    margin: 0px;
    overflow: hidden;
    -ms-overflow-style: scrollbar;
  }
</style>
</head>
<body>
<textarea id="source">package com.sencha.gxt.explorer.client.tabs;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.examples.resources.client.Resources;
import com.sencha.gxt.examples.resources.client.TestData;
import com.sencha.gxt.explorer.client.app.ui.ExampleContainer;
import com.sencha.gxt.explorer.client.model.Example.Detail;
import com.sencha.gxt.widget.core.client.PlainTabPanel;
import com.sencha.gxt.widget.core.client.TabItemConfig;
import com.sencha.gxt.widget.core.client.TabPanel;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;

public class BasicTabExample implements IsWidget, EntryPoint {

  protected static final int MIN_HEIGHT = 320;
  protected static final int MIN_WIDTH = 320;

  private VerticalLayoutContainer widget;

  @Override
  public Widget asWidget() {
    if (widget == null) {
      String text = TestData.DUMMY_TEXT_SHORT;

      HTML shortText = new HTML(text);
      shortText.addStyleName("pad-text");

      HTML longText = new HTML(text + "<br><br>" + text);
      longText.addStyleName("pad-text");

      Label normalLabel = new Label("Just a plain old tab");
      normalLabel.addStyleName("pad-text");

      Label iconLabel = new Label("Just a plain old tab with an icon");
      iconLabel.addStyleName("pad-text");
      
      Label disabledLabel = new Label("This tab should be disabled");
      disabledLabel.addStyleName("pad-text");

      TabItemConfig iconTab = new TabItemConfig("Icon Tab");
      iconTab.setIcon(Resources.IMAGES.table());

      TabItemConfig disabledTab = new TabItemConfig("Disabled");
      disabledTab.setEnabled(false);

      TabPanel folderTabPanel = new TabPanel();
      folderTabPanel.setWidth(450);
      folderTabPanel.add(shortText, "Short Text");
      folderTabPanel.add(longText, "Long Text");

      final PlainTabPanel tabPanel = new PlainTabPanel();
      tabPanel.setPixelSize(450, 250);
      tabPanel.add(normalLabel, "Normal");
      tabPanel.add(iconLabel, iconTab);
      tabPanel.add(disabledLabel, disabledTab);

      widget = new VerticalLayoutContainer();
      widget.add(folderTabPanel, new VerticalLayoutData(1, 0.5, new Margins(0, 0, 10, 0)));
      widget.add(tabPanel, new VerticalLayoutData(1, 0.5, new Margins(10, 0, 0, 0)));
    }

    return widget;
  }

  @Override
  public void onModuleLoad() {
    new ExampleContainer(this)
        .setMinHeight(MIN_HEIGHT)
        .setMinWidth(MIN_WIDTH)
        .doStandalone();
  }

}
</textarea>

<script src="../../samples/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
  var type = "{type}";
  if (type == ("{" + "type}")) {
    // something went wrong, use java as default
    type = "java";
  }
  var editor = ace.edit("source");
  var mode = "ace/mode/" + type;
  var theme = "ace/theme/chrome";
  var readOnly = true;
  editor.getSession().setMode(mode);
  editor.getSession().setUseWorker(false);
  editor.setTheme(theme);
  editor.setShowPrintMargin(false);
  editor.renderer.setShowGutter(true);
  editor.setHighlightActiveLine(false);
  editor.setDisplayIndentGuides(true);
  editor.setReadOnly(readOnly);
  editor.renderer.setPadding(10);
  editor.renderer.setScrollMargin(10, 10, 0, 0);
  editor.getSession().setOptions({
    tabSize: 8,
    useSoftTabs: true,
    useWrapMode: false,
  });
</script>
</body>
</html>